package com.leyou.personnel.controller;


import com.leyou.common.pojo.Result;
import com.leyou.annotation.AuthorityForResultCheck;
import com.leyou.personnel.data.vo.RoleListShowSearchVo;
import com.leyou.personnel.service.AdministratorsRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xhh
 * @since 2022-05-18
 */
@RestController
@RequestMapping("/leyou.personnel/administrators-role")
public class AdministratorsRoleController {
    @Autowired
    private AdministratorsRoleService administratorsRoleService;
    /**
     * 下拉框简单获取
     *
     * @author: xhh
     * @date: 2022/5/26
     * @description:
     * @return:
     * @params:
     */
    @RequestMapping(value = "/roleList",method = RequestMethod.POST)
    public Result roleList(){
        return administratorsRoleService.roleList();
    }
    /**
     * 带分页和搜索参数的查询
     *
     * @author: xhh
     * @date: 2022/5/26
     * @description:
     * @return:
     * @params:
     */
    @AuthorityForResultCheck(authority = "au009")
    @RequestMapping(value = "/roleListShow",method = RequestMethod.POST)
    public Result roleListShow(RoleListShowSearchVo vo){
        return administratorsRoleService.roleListShow(vo);
    }
    /**
     * role批量删除
     *
     * @author: xhh
     * @date: 2022/5/26
     * @description:
     * @return:
     * @params:
     */
    @AuthorityForResultCheck(authority = "au012")
    @RequestMapping(value = "/roleDel",method = RequestMethod.POST)
    public Result roleDel(@RequestParam("dataList") List<String> list){
        return administratorsRoleService.roleDel(list);
    }

}

